package com.longge;

/**
 * @创建人 xinglongge
 * @创建时间 2021/9/24
 * @描述
 */
public class CanJump {

    public boolean canJump(int[] nums) {

        int distance = 1;
        for (int i = nums.length - 2; i >= 0; i--) {
            if (nums[i] < distance) {
                distance++;
            } else {
                distance = 1;
            }
        }
        return distance == 1;

    }
}
